package co.edu.unal.geditor.controller.action.edit.color;

import java.awt.event.ActionEvent;

import co.edu.unal.geditor.controller.App;
import co.edu.unal.geditor.controller.action.undoable.color.UndoableChangeBackgroundColorAction;

public class ChangeBackgroundColorAction extends ChangeColorAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public ChangeBackgroundColorAction() {
		// auto-boxing Java feature
		super("BackGround Color");

	}

	@Override
	public void actionPerformed(ActionEvent e) {
		super.actionPerformed(e);
		if (color != null) {
			App.getInstance().getDrawing().addUndoable(new UndoableChangeBackgroundColorAction());
			App.getInstance().getDrawing().setcolorBackground(color);
		}
		else{
			color=App.getInstance().getDrawing().getcolorBackground();
		}

	}

}
